﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Vowei.Core;
using System.Globalization;
using System.Linq.Expressions;
using System.ComponentModel.DataAnnotations;

namespace Vowei.Test.Library
{
    class TestFakeTranslator : ITranslator
    {
        public CultureInfo Culture { get; private set; }

        public TestFakeTranslator(CultureInfo culture)
        {
            Culture = culture;
        }

        public string T(string message)
        {
            // TODO: 实现本地化支持！
            return message;
        }

        public string T(DateTime value)
        {
            return value.ToString(Culture);
        }

        public string T(double value)
        {
            return value.ToString(Culture);
        }

        public string T<U, TProperty>(Expression<Func<U, TProperty>> expression)
        {
            return Translator.T(this, expression);
        }
    }
}
